<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="invCierre" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{invCierreHome.managed ? 'Editar' : 'Agregar'} Cierre de Bodega</f:facet>



            <s:decorate id="crrDepcodigoField" template="layout/edit.xhtml">
                <ui:define name="label">Bodega:</ui:define>
                <h:selectOneMenu value="#{invCierreHome.instance.auxsubDep}"
                        defaultLabel="Seleccione..." directInputSuggestions="true"
                        enableManualInput="false">

                        <f:selectItems value="#{grupoListado.bodegaSelectItems}" />
                    </h:selectOneMenu>
            </s:decorate>


            <s:decorate id="crrFechaField" template="layout/edit.xhtml">
                <ui:define name="label">Fecha:</ui:define>
                <rich:calendar id="crrFecha"
                       required="true"
                          value="#{invCierreHome.instance.crrFecha}" datePattern="MM/dd/yyyy" />
            </s:decorate>


            



            <div style="clear:both">
                <span class="required">*</span>
                campos requeridos
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Cerrar"
                         action="#{invCierreHome.persist}"
                       disabled="#{!invCierreHome.wired}"
                       rendered="#{!invCierreHome.managed}"/>

            <h:commandButton id="update"
                          value="Actualizar"
                         action="#{invCierreHome.update}"
                       rendered="#{invCierreHome.managed}"/>

            <h:commandButton id="delete"
                          value="Eliminar"
                         action="#{invCierreHome.remove}"
                      immediate="true"
                       rendered="#{invCierreHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancelar"
             propagation="end"
                    view="/InvCierre.xhtml"
                rendered="#{invCierreHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancelar"
             propagation="end"
                    view="/#{empty invCierreFrom ? 'InvCierreList' : invCierreFrom}.xhtml"
                rendered="#{!invCierreHome.managed}"/>

        </div>
    </h:form>


</ui:define>

</ui:composition>
